<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="ko">
	<head>
		<%@ include file="head.jsp"%>
		<style type="text/css">
			html, body {
				width: 100%;
				height: 100%;
			}
			
			body {
				padding-top : 40px;
				padding-bottom : 40px;
				background: #eee url('assets/img/login_bg.png') no-repeat center center;
				background-size: cover;
			}
			
			.form-signin {
				max-width: 330px;
				padding: 15px;
				margin: auto auto;
			}
			
			.form-signin h2, .form-signin .checkbox {
				margin-bottom: 10px;
				color: #eee;
				text-shadow: 0 1px 1px #000;
			}
			
			.form-signin .checkbox {
				font-weight: normal;
			}
			
			.form-signin .form-control {
				position: relative;
				font-size: 16px;
				height: auto;
				padding: 10px;
				-webkit-box-sizing: border-box;
				-moz-box-sizing: border-box;
				box-sizing: border-box;
			}
			
			.form-signin .form-control:focus {
				z-index: 2;
			}
			
			.form-signin input[type="text"] {
				margin-bottom: -1px;
				border-bottom-left-radius: 0;
				border-bottom-right-radius: 0;
			}
			
			.form-signin input[type="password"] {
				margin-bottom: 10px;
				border-bottom-left-radius: 0;
				border-bottom-right-radius: 0;
			}
			
			.form-signin .col-sm-6 {
				padding-top: 5px !important;
			}
			@media (min-width: 768px) {
				.form-signin .col-sm-6:first-child {
					padding-right: 5px !important;
				}
				
				.form-signin .col-sm-6:last-child {
					padding-left: 5px !important;				
				}
			}
		</style>
	</head>

	<body>
	
		<div class="container">
			<form name="loginForm" class="form-signin" role="form" method="post" action="index.do">
				<h2>로그인이 필요합니다.</h2>
				<input type="text" id="admin_id" name="admin_id" class="form-control" placeholder="아이디를 입력하세요."
					<c:if test="${save_id != null}">value="${save_id}"</c:if> <c:if test="${save_id == null}">autofocus</c:if>>
				<input type="password" id="admin_pw" name="admin_pw" class="form-control" placeholder="비밀번호를 입력하세요."
					<c:if test="${save_id != null}">autofocus</c:if>>
				<label class="checkbox">
					<input type="checkbox" name="save_id" value="Y" <c:if test="${save_id != null}">checked</c:if>/>
				아이디 저장기능 사용 </label>
				<button class="btn btn-lg btn-primary btn-block" type="submit">
					로그인
				</button>
			</form>
		</div>
		
		<!-- Javascript -->
		<script src="assets/js/jquery.js"></script>
		<script src="assets/js/bootstrap.min.js"></script>
		<!-- 형식검사 클래스 참조 -->
		<script src="assets/js/string.js"></script>
		<script type="text/javascript">
			$(function() {
				$("form[name='loginForm']").submit(function() {
					if (!$("#admin_id").val().isValue()) {
						alert("아이디를 입력하세요.");
						$("#admin_id").focus();
						return false;
					}
					
					if (!$("#admin_pw").val().isValue()) {
						alert("비밀번호를 입력하세요.");
						$("#admin_pw").focus();
						return false;
					}
				});
			});
		</script>
	</body>
</html>